﻿<UserControl x:Class="Frontend.LegendPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    Name="RootControl">    
    <UserControl.Resources>
        <Style x:Key="LegendItemDockPanel">
            <Setter Property="DockPanel.VerticalAlignment" Value="Stretch" />            
        </Style>
        <Style x:Key="LegendItemBorder">
            <Setter Property="Border.Margin" Value="1" />
            <Setter Property="Border.Padding" Value="1 0" />
            <Setter Property="Border.BorderBrush">
                <Setter.Value>
                    <SolidColorBrush Color="Black" />
                </Setter.Value>
            </Setter>
            <Setter Property="Border.BorderThickness" Value="1" />
        </Style>
        <Style x:Key="LegendItemTextBlock">            
            <Setter Property="TextBlock.TextAlignment" Value="Center" />            
            <Setter Property="TextBlock.VerticalAlignment" Value="Center" />            
        </Style>
    </UserControl.Resources>
    
    <Expander Name="LegendGroupBox" Header="Legend" IsExpanded="True">
        <GroupBox Padding="0 5 0 0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.5*"/>
                    <RowDefinition Height="0.5*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*"/>
                    <ColumnDefinition Width="0.5*"/>
                </Grid.ColumnDefinitions>
                
                <DockPanel Grid.Row="0" Grid.Column="0" 
                           Name="AvailableDockPanel"
                           Style="{StaticResource LegendItemDockPanel}">
                    
                    <Border Name="AvailableBorder" 
                            Style="{StaticResource LegendItemBorder}" 
                            Background="{Binding ElementName=RootControl,Path=AvailableBrush}">
                        
                        <TextBlock Name="AvailableTextBlock"
                                   Style="{StaticResource LegendItemTextBlock}">                           
                            Available
                        </TextBlock >
                        
                    </Border>
                </DockPanel>

                <DockPanel Grid.Row="1" Grid.Column="0" 
                           Name="AvailableWaitListDockPanel"
                           Style="{StaticResource LegendItemDockPanel}">

                    <Border Name="AvailableWaitListBorder" 
                            Style="{StaticResource LegendItemBorder}" 
                            Background="{Binding ElementName=RootControl,Path=AvailableWaitListBrush}">

                        <TextBlock Name="AvailableWaitListTextBlock" 
                                   Style="{StaticResource LegendItemTextBlock}">
                            Wait List only
                        </TextBlock >
                        
                    </Border>
                </DockPanel>

                <DockPanel Grid.Row="0" Grid.Column="1" 
                           Name="ReservedDockPanel"
                           Style="{StaticResource LegendItemDockPanel}">

                    <Border Name="ReservedBorder" 
                            Style="{StaticResource LegendItemBorder}" 
                            Background="{Binding ElementName=RootControl,Path=ReservedBrush}">

                        <TextBlock Name="ReservedTextBlock" 
                                   Style="{StaticResource LegendItemTextBlock}">
                             Reserved by me
                        </TextBlock >

                    </Border>
                </DockPanel>       
                
                <DockPanel Grid.Row="1" Grid.Column="1" 
                           Name="ReservedWaitListDockPanel"
                           Style="{StaticResource LegendItemDockPanel}">

                    <Border Name="ReservedWaitListBorder" 
                            Style="{StaticResource LegendItemBorder}" 
                            Background="{Binding ElementName=RootControl,Path=ReservedWaitListBrush}">

                        <TextBlock Name="ReservedWaitListTextBlock" 
                                   Style="{StaticResource LegendItemTextBlock}">
                             I'm on Wait List
                        </TextBlock >
                        
                    </Border>
                </DockPanel>       

            </Grid>
        </GroupBox>
    </Expander>
</UserControl>
